#ifndef MONKEY_H
#define MONKEY_H

#include "worldobject.h"
#include <QString>
#include <QDebug>

class Monkey : public WorldObject
{
private:

    MonkeySide side;    // -1 if monkey is on left side; 1 if on right side
    Direction dir;      // direction in which the monkey has to move, 1 for down, -1 for up

    bool moveThisTime;  // b/c monkey is only moved every 2nd hit of game timer

    int targetId;       // only needed for Monkey AI
    int cocoTime;       // only needed for AI, it is the time in ms since the last coconut-shot
    int maxLoadTime;    // only needed for AI; the maximal

public:

    Monkey();
    Monkey(MonkeySide i_side);

    // increases the score by <s>
    void increaseScore(int s);

    // updates the monkeys position
    void updatePosition();

    // sets the next image in <image>
    void nextImage();

    void increaseCocoTime(int t);
    void resetCocoTime() { cocoTime = 0; }
    void setMaxLoadTime();

    // getter & setter
    int getSide() { return side; }
    int getTargetId() { return targetId; }
    int getCocoTime() { return cocoTime; }
    int getMaxLoadTime() { return maxLoadTime; }

    void setDirection(Direction d) { dir = d; speed = MONKEY_CLIMBING_SPEED.at(_difficulty_) * dir; }
    void setTargetId(int newId) { targetId = newId; }

    ~Monkey();
};

#endif // MONKEY_H
